package aop;

import org.aspectj.lang.ProceedingJoinPoint;

public class TimeCheckAdvice {

	// In case of arroundAdvice, the target method is executed inside of advice.
	// Thus, the ProceedingJoinPoint which has the functionality of executing target method should be handed to this advice.
	// ProceedingJoinPoint is usable in case of arroundAdvice
	public Object check(ProceedingJoinPoint joinPoint) throws Throwable {
		System.out.println("method start ....");
		
		// business logic is not executed unless proceed() is called.
		Object returnValue = joinPoint.proceed();
		
		System.out.println("method end....");
		
		// should return the return value of target method.
		return returnValue;
	}
	
}
